using System;
using System.Text;

namespace iBeauty.BusinessObjects
{
	[Serializable()]
	public class Account
	{
		private string _ID;

		public string ID
		{
			get { return _ID; }
			set { _ID = value; }
		}

		private DateTime? _CreateDate;

		public DateTime? CreateDate
		{
			get { return _CreateDate; }
			set { _CreateDate = value; }
		}

		private DateTime? _ModifiedDate;

		public DateTime? ModifiedDate
		{
			get { return _ModifiedDate; }
			set { _ModifiedDate = value; }
		}

		private DateTime? _TimeStamp;

		public DateTime? TimeStamp
		{
			get { return _TimeStamp; }
			set { _TimeStamp = value; }
		}

		private string _UserName;

		public string UserName
		{
			get { return _UserName; }
			set { _UserName = value; }
		}

		private string _Password;

		public string Password
		{
			get { return _Password; }
			set { _Password = value; }
		}

		private string _Permit;

		public string Permit
		{
			get { return _Permit; }
			set { _Permit = value; }
		}

		private string _Note;

		public string Note
		{
			get { return _Note; }
			set { _Note = value; }
		}

		public Account()
		{ }

		public Account(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string UserName,string Password,string Permit,string Note)
		{
			this.ID = ID;
			this.CreateDate = CreateDate;
			this.ModifiedDate = ModifiedDate;
			this.TimeStamp = TimeStamp;
			this.UserName = UserName;
			this.Password = Password;
			this.Permit = Permit;
			this.Note = Note;
		}

		public override string ToString()
		{
			return "ID = " + ID + ",CreateDate = " + CreateDate.ToString() + ",ModifiedDate = " + ModifiedDate.ToString() + ",TimeStamp = " + TimeStamp.ToString() + ",UserName = " + UserName + ",Password = " + Password + ",Permit = " + Permit + ",Note = " + Note;
		}

		public class IDComparer : System.Collections.Generic.IComparer<Account>
		{
			public SorterMode SorterMode;
			public IDComparer()
			{ }
			public IDComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Account> Membres
			int System.Collections.Generic.IComparer<Account>.Compare(Account x, Account y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ID.CompareTo(x.ID);
				}
				else
				{
					return x.ID.CompareTo(y.ID);
				}
			}
			#endregion
		}
		public class UserNameComparer : System.Collections.Generic.IComparer<Account>
		{
			public SorterMode SorterMode;
			public UserNameComparer()
			{ }
			public UserNameComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Account> Membres
			int System.Collections.Generic.IComparer<Account>.Compare(Account x, Account y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.UserName.CompareTo(x.UserName);
				}
				else
				{
					return x.UserName.CompareTo(y.UserName);
				}
			}
			#endregion
		}
		public class PasswordComparer : System.Collections.Generic.IComparer<Account>
		{
			public SorterMode SorterMode;
			public PasswordComparer()
			{ }
			public PasswordComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Account> Membres
			int System.Collections.Generic.IComparer<Account>.Compare(Account x, Account y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Password.CompareTo(x.Password);
				}
				else
				{
					return x.Password.CompareTo(y.Password);
				}
			}
			#endregion
		}
		public class PermitComparer : System.Collections.Generic.IComparer<Account>
		{
			public SorterMode SorterMode;
			public PermitComparer()
			{ }
			public PermitComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Account> Membres
			int System.Collections.Generic.IComparer<Account>.Compare(Account x, Account y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Permit.CompareTo(x.Permit);
				}
				else
				{
					return x.Permit.CompareTo(y.Permit);
				}
			}
			#endregion
		}
		public class NoteComparer : System.Collections.Generic.IComparer<Account>
		{
			public SorterMode SorterMode;
			public NoteComparer()
			{ }
			public NoteComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Account> Membres
			int System.Collections.Generic.IComparer<Account>.Compare(Account x, Account y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Note.CompareTo(x.Note);
				}
				else
				{
					return x.Note.CompareTo(y.Note);
				}
			}
			#endregion
		}
	}
}
